import random
guessed = False

print 'Do you want to play a game? (Yes(Y)/No(N))'
choice = raw_input()

while (choice == 'y') or (choice == 'Y'):
    print ' I am thinking of a number between 1 and 100...'
    thenumber = random.randint (1,100)

    print 'What is your guess?'
    playerguess = int(raw_input())

    while not guessed:
        if playerguess > thenumber:
            print 'Your guess is too high!'
        elif thenumber > playerguess :
            print 'Your guess is too low!'
        else:
            guessed = True

        if not guessed:
            print 'What is your guess?'
            playerguess = int(raw_input())

    print 'Congratulations! You Guessed the number!'
    guessed = False

    print 'Do you want to guess another number?'
    choice = raw_input()

print 'Thanks for playing!'
